#include <cmath>
#include <fstream>
#include "sv2_saver.h"
#include <cmath>
#include <fstream>
#include <limits>
#include <vector>


using namespace std;


namespace sv2
{
  void SaverCppNode::run()
  {
    while (this->is_running())
    {
      // 主线程阻塞，等待队里中出现数据
      std::unique_lock<std::mutex> lock(this->_full_queue_mtx);
      this->_full_cv.wait(lock, [this]{ return !this->_full_queue.empty(); });

      ImgMsg imgmsg = this->_full_queue.front();
      this->_full_queue.pop();
      this->_vw.write(imgmsg.img, imgmsg.msg);
    }
  }
}
